package com.ruoyi.service.fanruan.impl;

import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.core.text.Convert;
import com.ruoyi.common.enums.DataSourceType;
import com.ruoyi.domain.jpjs.common.fanruan.SkFirst;
import com.ruoyi.mapper.fanruan.SkFirstMapper;
import com.ruoyi.service.fanruan.ISkFirstService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * 商开集团Service业务层处理
 *
 * @author ruoyi
 * @date 2020-11-04
 */
@Service
@Transactional(rollbackFor = Exception.class)
@DataSource(value = DataSourceType.SLAVE)
public class SkFirstServiceImpl implements ISkFirstService
{
    @Autowired
    private SkFirstMapper skFirstMapper;

    /**
     * 查询商开集团
     *
     * @param id 商开集团ID
     * @return 商开集团
     */
    @Override
    public SkFirst selectSkFirstById(Long id)
    {
        return skFirstMapper.selectSkFirstById(id);
    }

    /**
     * 查询商开集团列表
     *
     * @param skFirst 商开集团
     * @return 商开集团
     */
    @Override
    public List<SkFirst> selectSkFirstList(SkFirst skFirst)
    {
        return skFirstMapper.selectSkFirstList(skFirst);
    }

    /**
     * 新增商开集团
     *
     * @param skFirst 商开集团
     * @return 结果
     */
    @Override
    public int insertSkFirst(SkFirst skFirst)
    {
        return skFirstMapper.insertSkFirst(skFirst);
    }

    /**
     * 修改商开集团
     *
     * @param skFirst 商开集团
     * @return 结果
     */
    @Override
    public int updateSkFirst(SkFirst skFirst)
    {
        return skFirstMapper.updateSkFirst(skFirst);
    }

    /**
     * 删除商开集团对象
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteSkFirstByIds(String ids)
    {
        return skFirstMapper.deleteSkFirstByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除商开集团信息
     *
     * @param id 商开集团ID
     * @return 结果
     */
    @Override
    public int deleteSkFirstById(Long id)
    {
        return skFirstMapper.deleteSkFirstById(id);
    }
}
